package com.ouc.pampas;
import com.google.common.collect.ImmutableSet;
import java.io.Serializable;
import java.util.Set;
public class Component
  implements Serializable
{
  private static final long serialVersionUID = -1877549770928584021L;
  private String path;
  private ComponentCategory category;
  private String name;
  private String desc;
  private String service;
  
  public String toString()
  {
    return "Component(path=" + getPath() + ", category=" + getCategory() + ", name=" + getName() + ", desc=" + getDesc() + ", service=" + getService() + ")";
  }
  
  public String getPath()
  {
    return this.path;
  }
  
  public void setPath(String path)
  {
    this.path = path;
  }
  
  public ComponentCategory getCategory()
  {
    return this.category;
  }
  
  public Component()
  {
    this.category = ComponentCategory.ADMIN;
  }
  
  public void setCategory(ComponentCategory category)
  {
    this.category = category;
  }
  
  public String getName()
  {
    return this.name;
  }
  
  public void setName(String name)
  {
    this.name = name;
  }
  
  public String getDesc()
  {
    return this.desc;
  }
  
  public void setDesc(String desc)
  {
    this.desc = desc;
  }
  
  public String getService()
  {
    return this.service;
  }
  
  public void setService(String service)
  {
    this.service = service;
  }
  
  public static enum Mode
  {
    OFFICIAL(ImmutableSet.of(Component.ComponentCategory.COMMON, Component.ComponentCategory.OFFICIAL)),  TEMPLATE(ImmutableSet.of(Component.ComponentCategory.COMMON, Component.ComponentCategory.OFFICIAL, Component.ComponentCategory.SHOP)),  SHOP(ImmutableSet.of(Component.ComponentCategory.COMMON, Component.ComponentCategory.SHOP)),  ITEM(ImmutableSet.of(Component.ComponentCategory.COMMON, Component.ComponentCategory.ITEM)),  ITEM_TEMPLATE(ImmutableSet.of(Component.ComponentCategory.COMMON));
    
    private Set<Component.ComponentCategory> categories;
    
    public Set<Component.ComponentCategory> getCategories()
    {
      return this.categories;
    }
    
    private Mode(Set<Component.ComponentCategory> categories)
    {
      this.categories = categories;
    }
  }
  
  public static enum ComponentCategory
  {
    COMMON("通用", true),  ADMIN("后台", false),  OFFICIAL("官方", true),  SHOP("店铺", true),  ITEM("商品", true);
    
    private String name;
    private boolean designable;
    
    public String getName()
    {
      return this.name;
    }
    
    public boolean isDesignable()
    {
      return this.designable;
    }
    
    private ComponentCategory(String name, boolean designable)
    {
      this.name = name;
      this.designable = designable;
    }
  }
}
